package com.livestocksolutions.ui;

import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.livestocksolutions.R;
import com.livestocksolutions.intent.BaseActivity;

/* -- Version History --
 *  1.0 : 17 September 2012 - Initial version.
 */

/**
 * A base class to create the layout for a Feed Object
 * @author Adam Parr
 * @version 1.0
 * 
 * @.modified 17 September 2012
 */
public class ViewFeedArrayAdapter extends ViewUsableItemArrayAdapter {
	/**
	 * Size of the allowable array passed
	 */
	public static final int SIZE = 11;
	/**
	 * CVD number of the Feed in position within the String[position][{@value #CVDNO}]
	 * array passed in the Constructor.
	 */
	public static final int CVDNO = 10;
	
	/**
	 * Constructor
	 * @param context The current context.
	 * @param values The Group data to represent in the ListView.
	 */
	public ViewFeedArrayAdapter(BaseActivity context, String[] values) {
		super(context, new String[][]{values});
	}

	@Override
	public View getView(final int position, View convertView, ViewGroup parent) {
		if(textViewResourceId==0){
			setView(R.layout.item_feed_view);
		}
		View rowView = super.getView(position, convertView, parent);
		
		TextView feedCVDNo = (TextView)rowView.findViewById(R.id.cvdNo);
		
		feedCVDNo.setText(values[position][CVDNO]);

		return rowView;
	}
}
